package com.app.twth.ui.search;


import com.app.twth.app.Constant;
import com.app.twth.base.BaseModel;
import com.app.twth.bean.BaseResponseEntity;
import com.app.twth.net.JsonCallBack;
import com.lzy.okgo.OkGo;

import java.util.HashMap;
import java.util.Map;

public class SearchDataModel extends BaseModel {
    public <T> void searchContainer(String containerNo, JsonCallBack jsonCallBack) {
        Map<String, String> map = new HashMap<>();
        map.put("containerNo", containerNo);
        OkGo.<BaseResponseEntity<T>>get(Constant.searchContainer)
                .tag(this)
                .params(map)
                .execute(jsonCallBack);
    }

    public <T> void searchIbLpn(String ibLpn, JsonCallBack jsonCallBack) {
        Map<String, String> map = new HashMap<>();
        map.put("ibLpn", ibLpn);
        OkGo.<BaseResponseEntity<T>>get(Constant.searchIbLpn)
                .tag(this)
                .params(map)
                .execute(jsonCallBack);
    }

    public <T> void searchLocation(String locationCode, JsonCallBack jsonCallBack) {
        Map<String, String> map = new HashMap<>();
        map.put("locationCode", locationCode);
        OkGo.<BaseResponseEntity<T>>get(Constant.searchLocation)
                .tag(this)
                .params(map)
                .execute(jsonCallBack);
    }

    public <T> void searchObLpn(String obLpn, JsonCallBack jsonCallBack) {
        Map<String, String> map = new HashMap<>();
        map.put("obLpn", obLpn);
        OkGo.<BaseResponseEntity<T>>get(Constant.searchObLpn)
                .tag(this)
                .params(map)
                .execute(jsonCallBack);
    }

    public <T> void searchSku(String sku, JsonCallBack jsonCallBack) {
        Map<String, String> map = new HashMap<>();
        map.put("sku", sku);
        OkGo.<BaseResponseEntity<T>>get(Constant.searchSku)
                .tag(this)
                .params(map)
                .execute(jsonCallBack);
    }

    public <T> void searchTrk(String trk, JsonCallBack jsonCallBack) {
        Map<String, String> map = new HashMap<>();
        map.put("trk", trk);
        OkGo.<BaseResponseEntity<T>>get(Constant.searchTrk)
                .tag(this)
                .params(map)
                .execute(jsonCallBack);
    }

}